home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Dylan Related / Mindy-1.1 (sources only) / mindy-1.1 / interp / num.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-28  |  2.2 KB  |  68 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: num.h,v 1.4 94/06/27 16:32:26 wlott Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30. #define obj_is_fixnum(o) (!obj_is_ptr(o))
  31.  
  32. #define fixnum_value(o) (((long)(o))>>1)
  33. #define make_fixnum(i) ((obj_t)(((long)(i))<<1))
  34. #define MAX_FIXNUM ((obj_t)((((unsigned long)~0)<<2)>>1))
  35. #define MIN_FIXNUM ((obj_t)~(((unsigned long)~0)>>1))
  36.  
  37. extern obj_t obj_IntegerClass;
  38. extern obj_t obj_SingleFloatClass;     /* table.c needs the floats */
  39. extern obj_t obj_DoubleFloatClass;
  40. extern obj_t obj_ExtendedFloatClass;
  41.  
  42. struct single_float {
  43.     obj_t class;
  44.     float value;
  45. };
  46.  
  47. extern obj_t make_single(float value);
  48. #define single_value(x) (obj_ptr(struct single_float *, x)->value)
  49.  
  50. struct double_float {
  51.     obj_t class;
  52.     double value;
  53. };
  54.  
  55. extern obj_t make_double(double value);
  56. #define double_value(x) (obj_ptr(struct double_float *, x)->value)
  57.  
  58. struct extended_float {
  59.     obj_t class;
  60.     long double value;
  61. };
  62.  
  63. extern obj_t make_extended(long double value);
  64. #define extended_value(x) (obj_ptr(struct extended_float *, x)->value)
  65.  
  66. extern boolean idp(obj_t x, obj_t y);
  67.  
  68.